package com.zhuangjie.coupon.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhuangjie.coupon.entity.CouponProductBatch;
import com.zhuangjie.coupon.enums.CouponProductStatus;
import com.zhuangjie.coupon.mapper.CouponProductBatchMapper;
import com.zhuangjie.coupon.service.CouponProductBatchService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhuangjie
 * @since 2024-02-28
 */
@Service
public class CouponProductBatchServiceImpl extends ServiceImpl<CouponProductBatchMapper, CouponProductBatch> implements CouponProductBatchService {

    @Override
    public List<Long> queryAllListedProductAssociatedCouponBatchIds() {
        List<Long> couponBatchIds = this.baseMapper.queryAllListedProductAssociatedCouponBatchIds(CouponProductStatus.BUYABLE.getCode());
        return couponBatchIds == null ? new ArrayList<>() : couponBatchIds;
    }
}
